package com.chan.service.impl;

import java.util.List;

import com.chan.common.core.text.Convert;
import com.chan.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.chan.mapper.CdProgramPayNoteMapper;
import com.chan.domain.CdProgramPayNote;
import com.chan.service.ICdProgramPayNoteService;


/**
 * 交付清单Service业务层处理
 *
 * @author chan
 * @date 2024-04-30
 */
@Service
public class CdProgramPayNoteServiceImpl implements ICdProgramPayNoteService
{
    @Autowired
    private CdProgramPayNoteMapper cdProgramPayNoteMapper;

    /**
     * 查询交付清单
     *
     * @param id 交付清单主键
     * @return 交付清单
     */
    @Override
    public CdProgramPayNote selectCdProgramPayNoteById(Long id)
    {
        return cdProgramPayNoteMapper.selectCdProgramPayNoteById(id);
    }

    /**
     * 查询交付清单列表
     *
     * @param cdProgramPayNote 交付清单
     * @return 交付清单
     */
    @Override
    public List<CdProgramPayNote> selectCdProgramPayNoteList(CdProgramPayNote cdProgramPayNote)
    {
        return cdProgramPayNoteMapper.selectCdProgramPayNoteList(cdProgramPayNote);
    }

    /**
     * 新增交付清单
     *
     * @param cdProgramPayNote 交付清单
     * @return 结果
     */
    @Override
    public int insertCdProgramPayNote(CdProgramPayNote cdProgramPayNote)
    {
        cdProgramPayNote.setCreateTime(DateUtils.getNowDate());
        return cdProgramPayNoteMapper.insertCdProgramPayNote(cdProgramPayNote);
    }

    /**
     * 修改交付清单
     *
     * @param cdProgramPayNote 交付清单
     * @return 结果
     */
    @Override
    public int updateCdProgramPayNote(CdProgramPayNote cdProgramPayNote)
    {
        cdProgramPayNote.setUpdateTime(DateUtils.getNowDate());
        return cdProgramPayNoteMapper.updateCdProgramPayNote(cdProgramPayNote);
    }

    /**
     * 批量删除交付清单
     *
     * @param ids 需要删除的交付清单主键
     * @return 结果
     */
    @Override
    public int deleteCdProgramPayNoteByIds(String ids)
    {
        return cdProgramPayNoteMapper.deleteCdProgramPayNoteByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除交付清单信息
     *
     * @param id 交付清单主键
     * @return 结果
     */
    @Override
    public int deleteCdProgramPayNoteById(Long id)
    {
        return cdProgramPayNoteMapper.deleteCdProgramPayNoteById(id);
    }
}
